1. Field of the Invention
The present invention relates to a character code conversion unit for converting the code system of character data.
In developing software in recent years, it is a generally accepted practice to manage the source files and the text files as a common file on a network. In this case, when an apparatus (or a system) having a different character code system exists on the network, and when the apparatus that uses a character code system different from that of the common file on the network makes reference to, or updates, the contents of the file, the common file cannot be effectively utilized unless the data are processed by taking the character code system into consideration. It has therefore been desired to reliably effect the code conversion without developing errors when the data are input to, or output from, the apparatus that operates on a code system which is different from that of the common file.
2. Description of the Related Art
The related art is explained hereinafter with reference to FIG. 1. In the example of FIG. 1, a plurality of kinds of machines (data processors, such as microcomputers or systems) are connected to a server machine through a network such as a LAN (local area network).
In FIG. 1, reference numeral 50 denotes a UNIX machine (registered trademark of X/Open Company Limited) which uses EUC (extended Unix code) as the character code, 51 denotes a server machine equipped with a storage file 51a (common file) of a character code common to all of the machines, 52 denotes an MS-DOS machine (registered trademark of Microsoft Corporation) which uses a SHIFT-JIS (Japanese Industrial Standard) code and is equipped with an output file 52a of the SHIFT-JIS code, 53 denotes a UNIX machine which uses the EUC code and is equipped with an output file 33a of this code, and reference numeral 54 denotes a host machine which uses an EBCDIC (extended binary-coded decimal interchange code) and is equipped with an output file 54a of this code.
The server machine 51 is provided with a storage file 51a, so that the source file and the text file can be managed as a common file by the machines on the network. Each machine makes reference to the storage file 51a and updates the data. However, a machine that uses a code different from the code system of the storage file 51a must convert the code which is input thereto a code which is adapted for use thereby, every time the data is input.
The character code of the storage file 51a of the server machine 51 is selected to be a code which is efficient for the machines on the network. In this example, the code of the storage file 51a is presumed to be the SHIFT-JIS code.
In FIG. 1, when the input file 50a created by the UNIX machine 50 is to be stored in the storage file 51a of the server machine 51, the user must designate, to the code converter 50b, the SHIFT-JIS code which is a code system of the server machine 51, as a converted output data of the code converter 50b. The data created by using the EUC code of the input file 50a, relying upon the code conversion operation, is converted into a SHIFT-JIS code and is stored in the storage file 51a of the server machine 51.
The data input from the UNIX machine 50 and stored in the storage file 51a can be referred to and updated by the other machines 52 to 54 via the network.
When the MS-DOS machine 52 makes reference to the storage file 51a, access is made to the server machine 51 via the network to take out the data. In this case, the user of the MS-DOS machine 52 is aware that the server machine 51 and the user's machine are using the same SHIFT-JIS code. Therefore, the user so designates that the conversion operation will not be carried out by the code converter 52b, and the data read out from the storage file 51a are stored in the output file 52a.
On the other hand, when the host machine 54 accesses the storage file 51a in the server machine 51 to take out the data, the user of the host machine 54 designates the SHIFT-JIS code as an input code to the code converter 54b. The code converter 54b then converts the data from the storage file 51a into the EBCDIC code.
However, the EBCDIC code includes a plurality of systems such as kana, English small letter, ASCII (American Standard Code for Information Interchange), and the code may often be overlapped (i.e., the same code represents different letters) making the conversion impossible. In this case, the code converter 54b finds that the conversion is impossible, and an error message is displayed stating that reediting is necessary. When this error message is displayed, the user of the UNIX machine 50, who has created the input file, reedits the content of the input file 50a so that it can be converted into the EBCDIC code (for example, tries not to use English small letters).
The foregoing has described an example where the data were input to the server machine 51 from the UNIX machine 50, and the data were output from the server machine 51 to the machines 52 to 54. However, the same operation is carried out even when the data are input to the server machine 51 from the machines 52 to 54 or the data are output from the server machine 51 to other machines. Therefore, each machine is provided with both a code converter (e.g., 50b) for use at the time of input and a code converter (e.g., 52b) for use at the time of output.
According to the above-mentioned prior art, the user of the machine must designate an input code (code of data to be input) through a short arrow when the data is to be input to the code converter and must designate an output code (converted character code) through a short arrow when the data is to be output, requiring cumbersome operations and leaving a chance of erroneous designations.
Moreover, no error occurs when the EUC code of the UNIX machine 50 of FIG. 1 is stored in the storage file 51a of the server machine 51, but a conversion error occurs for the first time when access is made to the storage file 51a from the host machine 54. On the side of the machine inputting the data, therefore, additional processing must be carried out such as reediting the conversion error that has occurred later. Moreover, reliability for the storage file is lost since it is not certain when an error would occur while converting the data in the storage file 51a into various codes.